package com.ufida.ids.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	private static String pattern1 = "yyyy-MM-dd HH:mm:ss";
	private static String pattern2 = "yyyy-MM-dd";
	private static SimpleDateFormat sdf1 = new SimpleDateFormat(pattern1);
	private static SimpleDateFormat sdf2 = new SimpleDateFormat(pattern2);
	public static String getDateStrPattern1(Date d){
		return sdf1.format(d);
	}
	public static String getDateStrPattern2(Date d){
		return sdf2.format(d);
	}
	public static Date getDateByStr(String dateStr) throws ParseException{
		return sdf2.parse(dateStr);
	}

}
